From: Florian Müllner Date: Mon, 3 Nov 2025 11:49:12 +0000 (+0100) Subject: js: Always use SOURCE_CONTINUE/SOURCE_REMOVE in later handlers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~66^2^2~15 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ca70a146cd3321bbc25b9ad4d1fb581a8628410b;p=gnome-shell.git js: Always use SOURCE_CONTINUE/SOURCE_REMOVE in later handlers The constants are more self-explanatory (and therefore readable) then plain true/false. Part-of: (cherry picked from commit 9fc7f3f439ae95646882dd8b60d08003a38daaf5) --- diff --git a/js/gdm/authList.js b/js/gdm/authList.js index 6575ca4c0..4873a05c5 100644 --- a/js/gdm/authList.js +++ b/js/gdm/authList.js @@ -16,6 +16,7 @@ */ import Clutter from 'gi://Clutter'; +import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; import Meta from 'gi://Meta'; import St from 'gi://St'; @@ -114,7 +115,7 @@ export const AuthList = GObject.registerClass({ const laters = global.compositor.get_laters(); laters.add(Meta.LaterType.BEFORE_REDRAW, () => { this._moveFocusToItems(); - return false; + return GLib.SOURCE_REMOVE; }); } } diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 1b568cbde..3f2f512c9 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -208,7 +208,7 @@ const UserList = GObject.registerClass({ const laters = global.compositor.get_laters(); laters.add(Meta.LaterType.BEFORE_REDRAW, () => { this._moveFocusToItems(); - return false; + return GLib.SOURCE_REMOVE; }); } } diff --git a/js/ui/dash.js b/js/ui/dash.js index f9b55c040..5037ad5f1 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -264,7 +264,7 @@ class ShowAppsIcon extends DashItemContainer { const laters = global.compositor.get_laters(); laters.add(Meta.LaterType.BEFORE_REDRAW, () => { AppFavorites.getAppFavorites().removeFavorite(id); - return false; + return GLib.SOURCE_REMOVE; }); return true; @@ -978,7 +978,7 @@ export const Dash = GObject.registerClass({ appFavorites.moveFavoriteToPos(id, favPos); else appFavorites.addFavoriteAtPos(id, favPos); - return false; + return GLib.SOURCE_REMOVE; }); return true; diff --git a/js/ui/main.js b/js/ui/main.js index 40898e15c..4a011f262 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -944,7 +944,7 @@ function _queueBeforeRedraw(workId) { const laters = global.compositor.get_laters(); laters.add(Meta.LaterType.BEFORE_REDRAW, () => { _runBeforeRedrawQueue(); - return false; + return GLib.SOURCE_REMOVE; }); } } diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index d654228fc..f3e6c4d99 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -225,12 +225,12 @@ class WorkspaceTracker { if (!Meta.prefs_get_dynamic_workspaces()) { this._checkWorkspacesId = 0; - return false; + return GLib.SOURCE_REMOVE; } // Update workspaces only if Dynamic Workspace Management has not been paused by some other function if (this._pauseWorkspaceCheck) - return true; + return GLib.SOURCE_CONTINUE; for (i = 0; i < this._workspaces.length; i++) { let lastRemoved = this._workspaces[i]._lastRemovedWindow; @@ -290,7 +290,7 @@ class WorkspaceTracker { } this._checkWorkspacesId = 0; - return false; + return GLib.SOURCE_REMOVE; } keepWorkspaceAlive(workspace, duration) {